// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import 'babel-polyfill'
import Vue from 'vue'
import App from './App'
import router from './router'
import Mock from "mockjs"
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '@/assets/css/base.css'
import '@/assets/css/markdow.css'
import * as echarts from 'echarts';
import axios from 'axios'
import VueAxios from 'vue-axios'
import './assets/js/directives.js'
import 'github-markdown-css';
import util from "@/assets/js/util"
// import audio from 'vue-mobile-audio'
// import ChildItemTable from "@/components/baseComponents/parentChildTable/parentChildItem"
import { queryApi} from '@/api/api'
Vue.use(ElementUI)
Vue.use(Mock)
// Vue.use(ChildItemTable)
// VueAxios.use(audio)
Vue.prototype.$echarts = echarts;
Vue.config.productionTip = false
// 路由控制
// router.beforeEach((to, from, next) => {
//   if (to.matched.length === 0) {
//     next('/');
//   } else {  
//       if(util.getCookie('vue_admin_template_token') && util.getCookie('vue_admin_template_token') !== ''){
//           util.setCookie('auth-token',util.getCookie('vue_admin_template_token'));
//       }
//       queryApi('/problem-api/base/islogin',{'token':util.getCookie('vue_admin_template_token')}).then(res => {
//         if(res.retCode == "0000000"){
//           next();
//         }else{
//           util.removeCookie('auth-token'); // 清除cookie登录票据
//           Vue.prototype.$alert('很抱歉，您未登录或者登录信息过期，请重新登录！', '提示', {
//               confirmButtonText: '确定',
//               callback: action => {
//                 window.location.href ="http://10.168.60.31/problem/#/login";
//               }
//             });
//           }
//       });
//   }
// });
/* eslint-disable no-new */
window.$VM = new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
 